using System;
using Evaluant.Uss.Models;
using Evaluant.Uss.MetaData;
using System.Globalization;

namespace Evaluant.Uss.Common
{
	public abstract class PersistenceEngineFactoryImplementation : IPersistenceProvider
	{
		protected Model _Model;
		protected CultureInfo _Culture;

		public PersistenceEngineFactoryImplementation()
		{
			_Model = new Model();
		}

		public abstract void InitializeConfiguration();

		public abstract IPersistenceEngine CreatePersistenceEngine();

		public virtual void RegisterMetaData(Evaluant.Uss.MetaData.IMetaData[] metadata)
		{
			ModelMetaDataVisitor visitor = new ModelMetaDataVisitor(_Model);
			foreach(IMetaData md in metadata)
				md.Accept(visitor);
		}

		public CultureInfo Culture
		{
			get { return _Culture; }
			set { _Culture = value; }
		}

	}
}
